/**
 * 作者: hwp
 * 日期: 2025-05-12 15:04:05
 * 备注: 联盟礼盒宝箱列表
 */
package com.motu.monstercity.server.game.userdata;

import com.motu.monstercity.server.game.base.AllParam;
import com.motu.vertx.module.utility.toolset.TimeUtils;

public class UnionGiftBoxList extends UnionGiftBoxListModel {
    public UnionGiftBoxList() {
        super();
    }

    public UnionGiftBoxList(long unionId, long userId, int type, String reward, String param) {
        super();
        putUnionId(unionId);
        putUserId(userId);
        putType(type);
        putActivateTime(TimeUtils.getCurTime());
        putReward(reward);
        putParam(param);
    }

    public void reset() { // 每日重置任务
        if (getActivateTime() + (long) AllParam.UNION_GIFT_BOX_SUSTAIN_TIME * TimeUtils.HOUR <= TimeUtils.getCurTime()) { // 只保留24小时
            delete();
        }
    }
}

